<?php

/**
 * dynamicinfomation form base class.
 *
 * @method dynamicinfomation getObject() Returns the current form's model object
 *
 * @package    nutrition
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasedynamicinfomationForm extends infomationForm
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['user_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('user'), 'add_empty' => true));
    $this->validatorSchema['user_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('user'), 'required' => false));

    $this->widgetSchema   ['is_active'] = new sfWidgetFormInputCheckbox();
    $this->validatorSchema['is_active'] = new sfValidatorBoolean(array('required' => false));

    $this->widgetSchema   ['views'] = new sfWidgetFormInputText();
    $this->validatorSchema['views'] = new sfValidatorInteger(array('required' => false));

    $this->widgetSchema   ['category_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('category'), 'add_empty' => true));
    $this->validatorSchema['category_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('category'), 'required' => false));

    $this->widgetSchema   ['flag'] = new sfWidgetFormInputCheckbox();
    $this->validatorSchema['flag'] = new sfValidatorBoolean(array('required' => false));

    $this->widgetSchema->setNameFormat('dynamicinfomation[%s]');
  }

  public function getModelName()
  {
    return 'dynamicinfomation';
  }

}
